<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8" />
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>职位收藏</title>
	<link rel="stylesheet" href="css/mui.min.css" />
	<!-- build:css css/app.css -->
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/common.css" />
	<!-- endbuild -->
</head>

<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">职位收藏</h1>
	</header>
	<div class="mui-content">
		<div class="recruiting"></div>
	</div>
	<script src="js/mui.min.js"></script>
	<script src="js/zepto.min.js"></script>
	<script src="js/template-web.js"></script>
	<!-- build:js js/app.js -->
	<script src="js/api.js"></script>
	<script src="js/tools.js" async></script>
	<!-- endbuild -->
	<script src="js/utils.js"></script>
	<script>
		$.ajax({
			url: config.ME_API + 'h5/h5GetAllCollectionPosition',
			type: 'post',
			data: {
				resumeId: getRid()
			},
			success: function (res) {
				if (res.code == 2) {
					$('.recruiting').append(template('positions', res.data))
				} else {
					mui.toast(res.msg)
				}
			},
			error: function (xhr, type, errorThrown) {
				mui.toast('网络连接失败, 请稍后再试!')
			}
		})
	</script>
	<script id="positions" type="text/html">
		<% if (recruitmentList.length) {%>
			<%for(var i = 0; i < recruitmentList.length; i ++) {%>
			<a href="jobdetails.html?rid=<%=recruitmentList[i].recruitmentId%>" class="recruiting-list">
				<div class="content">
					<div class="flex-row position-dec">
						<div class="recruiting-position">
							<%=recruitmentList[i].positionName%>
						</div>
						<div class="recruiting-money">
							<%=$imports.config.salaryRange[recruitmentList[i].payMoney]%>
							<% if (recruitmentList[i].payMoney > 1 && recruitmentList[i].payMoney < 10) { %>元/月<% } %>
						</div>
					</div>
					<div class="flex-row position-dec">
						<div class="recruiting-claim">
							<%=recruitmentList[i].cityName%> |
							<%=$imports.config.experience[recruitmentList[i].experienceRequire]%> |
							<%=$imports.config.edu[recruitmentList[i].educationRequire]%>
						</div>
						<div class="recruiting-time">
							<%=$imports.dateFormat(recruitmentList[i].updateTime, 'M-D')%>
						</div>
					</div>
					<div class="recruiting-tags">
						<% var welfareTreatment =  recruitmentList[i].welfareTreatment.split(',')%>
						<%for (var j = 0; j < welfareTreatment.length; j ++) {%>
							<% if (recruitmentList[i].welfareTreatment != '') { %>
								<span><%=$imports.config.welfare[welfareTreatment[j]]%></span>
							<% } else {%>
								<span>暂无福利</span>
							<%} %>
						<%}%>
					</div>
					<p class="recruiting-name"><%=recruitmentList[i].companyName%></p>
				</div>
			</a>
			<%}%>
		<%} else {%>
			<div class="no-positions">暂时没有收藏职位 赶紧去收藏吧!</div>
		<%}%>
	</script>
</body>

</html>